package org.leumasjaffe.math;

import java.util.ArrayList;
import java.util.List;

public abstract class PrimeFactors {
	public static Long[] factor(long number) {
		long n = number; 
		List<Long> factors = new ArrayList<Long>();
		for (long i = 2; i <= n/2; i++) {
			while (n % i == 0) {
				factors.add(i);
				n /= i;
			}
		}
		return ((Long[]) factors.toArray());
	}
	
}
